<?php

declare(strict_types=1);

namespace App\Controller\Api;

use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use App\Controller\AbstractController;

/**
 * 系统命令服务
 * @Controller(prefix="/SystemCommand")
 * @author chenshubo
 */
class SystemCommandController extends AbstractController
{ 
    /**
     * 重启NGINX服务
     * @RequestMapping(path="restartNginxService", methods="get")
     * @return string[]
     */
    public function restartNginxService(RequestInterface $request)
    {
        return shell_exec("sudo service nginx reload");
    }
}